import Vue from 'vue'
import components from './components'
const objs = {}
for(let k in components) {
	objs[k] = (options) => {
		if(typeof options === 'function') {
			//注册全局组件
			Vue.component(components[k].name, components[k])
		}else{
			//实例化ConfirmConstructor组件
			let AppComponentConstructor = Vue.extend(components[k]);
			let instance = new AppComponentConstructor({
				el:document.createElement('div'),
				propsData:options
			})
			//添加到boby
			document.body.appendChild(instance.$el);
			return instance;
		}
	}
}
export default objs